package guiscreens;

import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JList;


public class SearchResults extends JPanel {

	private CardLayout c1;
	private JPanel basePanel;
	private JFrame thisFrame;

	/**
	 * Create the panel.
	 */
	public SearchResults(final CardLayout c1, final JPanel basePanel, final JFrame thisFrame) {
		this.c1 = c1;
		thisFrame.setTitle("Search Rsults");
		this.basePanel = basePanel;
		this.thisFrame = thisFrame;
		thisFrame.setBounds(MainWindow.XCENTER - 350, MainWindow.YCENTER - 250, 700, 500);
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(51dlu;default)"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(59dlu;default):grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(67dlu;default)"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(49dlu;default)"),
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(23dlu;default):grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(25dlu;default)"),
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(21dlu;default)"),
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(24dlu;default)"),
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(27dlu;default)"),
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(25dlu;default)"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		JLabel lblId = new JLabel("ID");
		add(lblId, "2, 4");
		
		JLabel lblItemName = new JLabel("Item Name");
		add(lblItemName, "4, 4");
		
		JLabel lblCurrentBid = new JLabel("Current Bid");
		add(lblCurrentBid, "6, 4");
		
		JLabel lblHighBidder = new JLabel("High Bidder");
		add(lblHighBidder, "8, 4");
		
		JLabel lblGetItNow = new JLabel("Get It Now Price");
		add(lblGetItNow, "10, 4");
		
		JLabel lblAuctionEnds = new JLabel("Auction Ends");
		add(lblAuctionEnds, "12, 4");
		
		JButton btnBackToSearch = new JButton("Back to Search");
		btnBackToSearch.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent event)
			{
				c1.show(basePanel, "SEARCHCARD");
			}
		});
		add(btnBackToSearch, "12, 16");
	}

}
